package com.huluobo.higt4demo1911;

import android.app.Application;

import com.huluobo.higt4demo1911.core.db.DaoMaster;
import com.huluobo.higt4demo1911.core.db.DaoSession;
import com.huluobo.higt4demo1911.core.db.MyOpenHelper;

/**
 * Created by lc on 2022/4/21.
 */
public class App extends Application {
    private DaoMaster daoMaster;
    private static DaoSession daoSession;
    private MyOpenHelper devOpenHelper;

    @Override
    public void onCreate() {
        super.onCreate();
        devOpenHelper = new MyOpenHelper(this, "Data.db");
        //实例化DaoMaster对象
        daoMaster = new DaoMaster(devOpenHelper.getWritableDb());
        //实例化DaoSession对象
        daoSession = daoMaster.newSession();

    }

    public static DaoSession getDaoSession() {
        return daoSession;
    }
}
